package com.oitsm.mo.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * 分组 - 用于对 一组监测器进行归类/一组分组进行归类
 * @author Arab Runner
 * Jun 19, 2011 4:18:04 PM
 */
@SuppressWarnings("serial")
@Entity
@Table(name="node")
public class Node implements Serializable {
	/**
	 * 分组
	 */
	public static final int TYPE_GROUP = 0;
	/**
	 * 设备分组
	 */
	public static final int TYPE_DEVICE = 1;
	/**
	 * 指标分组
	 */
	public static final int TYPE_MONITOR_GOURP = 2;
	/**
	 * 检测器节点
	 */
	public static final int TYPE_MONITOR_NODE = 3;
	
	
	@Id
	@Column(name="id")
	@GeneratedValue(strategy=GenerationType.AUTO,generator="")
	private Long id;
	
	/**
	 * 父分组 id
	 */
	@Column(name="parentid",updatable=false) 
	private Long parentId;
	
	/**
	 * 名称
	 */
	@Column(name="name") 
	private String name;
	
	/**
	 * 类型 - 保留字段,用来区分分组的类型
	 */
	@Column(name="type",updatable=false) 
	private Integer type = 0;
	
	/**
	 * 节点的引用 - 当为检测器节点时,引用为检测器的ID
	 */
	@Column(name="ref",updatable=false) 
	private Long ref;
	
	public Node(){}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Long getRef() {
		return ref;
	}

	public void setRef(Long ref) {
		this.ref = ref;
	}
}
